import 'package:flutter/material.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBNavigator.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBXieGangAdModule/YBWangGeYuanPage/YBWangGeYuanSubPage.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBXieGangAdModule/YBWangGeYuanPage/YBWangGeYuanYaoQingPage.dart';


class YBMineGongHuiPage extends StatefulWidget {
  @override
  _YBMineGongHuiPageState createState() => _YBMineGongHuiPageState();
}

class _YBMineGongHuiPageState extends State<YBMineGongHuiPage> {
  ScrollController _scrollController = ScrollController();

  double _offsetInt = 0.0;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    setState(() {
      print("object-----${_scrollController.initialScrollOffset}--");
    });

    _scrollController.addListener(() {
      setState(() {
        _offsetInt = _scrollController.offset;
      });

    });

  }

  @override
  Widget build(BuildContext context) {


    return Container(
      color: YBColor.white,
      child: Scaffold(
        body: CustomScrollView(
          controller: _scrollController,
          slivers: <Widget>[
            SliverAppBar(
              title: _offsetInt.toInt() > 10?Text('公会',style: YBTextStyle.TextStyle30313320Medium):Text("公会",style: TextStyle(
                color: YBColor.white,
                fontSize: YBTextStyle.adapterSize20,
                fontWeight: FontWeight.w500,
              ),),
              leading: InkWell(
                child: _offsetInt.toInt() > 30?Image.asset(YBImageStyle.getImagePath('common_backimage')):Image.asset(YBImageStyle.getImagePath('common_whiteImage')),
                onTap: () async {
                  YBNavigatorUtil.goDefaultBack(context);
                },
              ),
              expandedHeight: 420,
              elevation: 0,
              pinned: true,
              snap: false,
              floating: false,
              flexibleSpace: FlexibleSpaceBar(
                background: Container(
                  child: Padding(
                    padding: EdgeInsets.only(left: 0,right: 0),
                    child: Stack(
                      children: [
                        Container(
                          decoration: BoxDecoration(
                            image: DecorationImage(
                              image: ExactAssetImage(YBImageStyle.getImagePath('xiegangqingnian_imageView')),
                              fit: BoxFit.fill,
                            ),
                          ),
                        ),
                        Container(
                          child: Padding(
                            padding: EdgeInsets.only(left: 20,right: 20,top: 280),
                            child: Image.asset(YBImageStyle.getImagePath('mine_gonghuipuka')),
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
              ),
            ),
            SliverToBoxAdapter(
              child:Container(
                color: YBColor.white,
                child: Padding(
                  padding: EdgeInsets.only(left:20,right: 20),
                  child: Column(
                    children: [
                      Container(
                        height: 15,
                      ),
                      Container(
                        child: Text(
                          "· 原始公会是什么 ·",
                          style: YBTextStyle.TextStyle18181816Medium,
                        ),
                      ),
                      Container(
                        height: 15,
                      ),
                      Container(
                        child: Text(
                          "原始公会，集中平台资源，联合地方机构，连接中小企业创始人，打造新的创新创业商圈。 原始公会，一个创业者帮助创业者，创业者学习创业者、创业者成就创业者的创始人合作体。",
                          style: YBTextStyle.TextStyle55C5C5C14,
                        ),
                      ),
                      Container(
                        height: 15,
                      ),
                    ],
                  ),
                ),
              ),
            ),
            SliverToBoxAdapter(
              child:Container(
                height: 12.0,
              ),
            ),
            SliverToBoxAdapter(
              child: Padding(
                padding: EdgeInsets.only(left: 0,right: 0),
                child: Container(
                  height: 326,
                  decoration: BoxDecoration(
                    color: YBColor.white,
                    borderRadius: BorderRadius.only(topLeft: Radius.circular(16.0),topRight: Radius.circular(16.0)),
                    border: Border.all(width: 0.5,color: YBColor.white),
                  ),
                  child: Column(
                    children: [
                      Container(height: 20,),
                      Container(
                        child: Text("· 原始公会卡权益 ·",style: YBTextStyle.xieGangQingNianGongzuoRenWuText,),
                      ),
                      Container(height: 30.0,),
                      Container(
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceAround,
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: [
                            YBWangGeYuanSubPage(imageStr: "fenxianghuke_gonghuiImageView",titleStr: "分享互客",subTitleStr: "丰富内容素材，赋能社交互动",),
                            YBWangGeYuanSubPage(imageStr: "zhangshangquanceng_gonghuiimageVIew",titleStr: "公会圈层",subTitleStr: "延伸自我价值，分享互助交流",),
                          ],
                        ),
                      ),
                      Container(height: 39.0,),
                      Container(
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceAround,
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: [
                            YBWangGeYuanSubPage(imageStr: "mine_zuzhiguanli",titleStr: "组织管理",subTitleStr: "数字化时代，赋能销售获客转化",),
                            YBWangGeYuanSubPage(imageStr: "banshimishu_gonghuiImageView",titleStr: "掌上秘书",subTitleStr: "您的办事秘书，一键确认呼叫",),
                          ],
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
            SliverToBoxAdapter(
              child: Container(
                color: YBColor.commonPageBackGroundColor,
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  crossAxisAlignment: CrossAxisAlignment.stretch,
                  children: [
                    Container(
                      height: 24,
                    ),
                    Container(
                      child: Image.asset(YBImageStyle.getImagePath("jiarugonghui_yuanshi"),height: 50,),
                    ),
                    Container(
                      child: Image.asset(YBImageStyle.getImagePath("arrowhead-down"),height: 50,),
                    ),
                    Container(
                      height: 12,
                    ),
                  ],
                ),
              ),
            ),
            SliverToBoxAdapter(
              child: Container(
                child: Column(
                  children: [
                    Container(
                      height: 20,
                    ),
                    Container(
                      child: Text("·第一步，申请加微信群·",style: YBTextStyle.xieGangQingNianGongzuoRenWuText),
                    ),
                    Container(
                      height: 24,
                    ),
                    Container(
                      child: Image.asset(YBImageStyle.getImagePath('mine_gongchonghao',format: 'jpg'),height: 200,width: 200,),
                    ),
                    Container(
                      height: 16.0,
                    ),
                    Container(
                      child: MaterialButton(
                          height: 36,
                          minWidth: 144,
                          shape: RoundedRectangleBorder(
                            side: BorderSide.none,
                            borderRadius: BorderRadius.all(Radius.circular(18.0)),
                          ),
                          color: YBColor.commonThemeColor,
                          child: Text("保存图片",style: YBTextStyle.xieGangQingNianBaoCunWhiteText,),
                          onPressed: (){
                            print('保存图片');

                          }),
                    ),
                    Container(
                      height: 24,
                    ),
                    Container(
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Container(
                            child: Text("群主微信号:",style: YBTextStyle.xieGangQingNianDisPlayText),
                          ),
                          Container(
                            width: 8,
                          ),
                          Container(
                            child: Text("13750888602"),
                          ),
                          Container(
                            width: 8,
                          ),
                          Container(
                            child: InkWell(
                              child: Text("复制",style:YBTextStyle.xieGangQingNianFuZhiText,),
                              onTap: (){

                              },
                            ),
                          ),
                          Container(
                            width: 3,
                          ),
                          Container(
                            child: Image.asset(YBImageStyle.getImagePath('lawyerImage_IconСolor'),width: 10,height: 10,),
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ),
            SliverToBoxAdapter(
              child: Container(
                height: 32,
              ),
            ),
            SliverToBoxAdapter(
              child: Container(
                alignment: Alignment.center,
                child: Text("进群后联系群主会有审核专人审核后",style: YBTextStyle.xieGangQingNianDisPlayText),
              ),
            ),
            SliverToBoxAdapter(
              child: Container(
                alignment: Alignment.center,
                child: Text("领取公会权益卡",style: YBTextStyle.xieGangQingNianDisPlayText),
              ),
            ),
            SliverToBoxAdapter(
              child: Container(
                height: 24,
              ),
            ),
            SliverToBoxAdapter(
              child:Container(
                color: YBColor.commonPageBackGroundColor,
                height: 12.0,
              ),
            ),
            SliverToBoxAdapter(
              child: Container(
                child: Column(
                  children: [
                    Container(
                      height: 20,
                    ),
                    Container(
                      child: Text("· 第二步：激活公会权益卡 ·",style: YBTextStyle.xieGangQingNianGongzuoRenWuText),
                    ),
                  ],
                ),
              ),
            ),
            SliverToBoxAdapter(
              child:Container(
                height: 24.0,
              ),
            ),
            SliverToBoxAdapter(
              child: Padding(
                padding: EdgeInsets.only(left: 20,right: 20),
                child: Container(
                  child: TextField(
                    decoration: InputDecoration(
                      hintText: "请输入公会权益卡激活码",
                      fillColor: YBColor.colorF5F6F7,
                      filled: true,
                      border: InputBorder.none,
                    ),
                  ),
                ),
              ),
            ),
            SliverToBoxAdapter(
              child:Container(
                height: 24.0,
              ),
            ),
            SliverToBoxAdapter(
              child: Container(
                height: 44,
                child: Padding(
                  padding: EdgeInsets.only(left: 20,right: 20),
                  child: MaterialButton(
                      shape: RoundedRectangleBorder(
                        side: BorderSide.none,
                        borderRadius: BorderRadius.all(Radius.circular(8.0)),
                      ),
                      color: YBColor.commonThemeColor,
                      child: Text("立即激活",style: YBTextStyle.xieGangQingNianTuiGuangYuanBtnText,),
                      onPressed:(){

                      }),
                ),
              ),
            ),
            SliverToBoxAdapter(
              child:Container(
                height: 22.0,
              ),
            ),
            SliverToBoxAdapter(
              child: Padding(
                padding: EdgeInsets.only(left: 20,right: 20),
                child: Container(
                  alignment: Alignment.center,
                  child: Text("1、激活码是公会权益的激活秘钥，每张公会权益卡对应的激活码唯一，刮开公会权益卡背面涂层可见",style: YBTextStyle.TextStyle7A7A7A12,),
                ),
              ),
            ),
            SliverToBoxAdapter(
              child: Container(
                child: Padding(
                  padding: EdgeInsets.only(top: 10,left: 20,right: 20),
                  child: Text(
                    " 2、输入激活码，即可开启办买省钱、办事省心的绿色通道。",
                    style: YBTextStyle.TextStyle7A7A7A12,
                  ),
                ),
              ),
            ),
            SliverToBoxAdapter(
              child: Container(
                height: 24,
              ),
            ),
          ],
        ),
      ),
    );
  }
}

